#include "stack.h"

int push(int *a, int top, int elem) {
  a[top++] = elem;
  return top;
}

int pop(int *a, int top, int *target) {
  if (top) {
    *target = a[top--];
    return top;
  }
  return -1;
}